{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<<script type="text/javascript">
<!--
$(function(){
	<eq name="order_info.order_status" value="0">
	$('.edit_num').click(function(){
		$('#edit_num_div', $(this).parent()).show();
	});
	
	$('.edit_num_ok').click(function(){
		var par = $(this).parent();
		var new_num = $('#new_num', par).val();
		
		if(new_num != parseInt(new_num)){
			alert('请输入有效的数字');
			return false;
		}
		
		$('#num_check', par.parent()).html(new_num);
		par.hide();
	});
	
	$('.edit_num_cancel').click(function(){
		var par = $(this).parent();
		var old_num = $('#num_check').html();
		$('#new_num', par).val(old_num);
		par.hide();
	});
	
	$('#amount_check').change(function(){
		var amount_check = this.value;
		if( amount_check != parseFloat(amount_check) ){
			alert('总金额格式错误');
			return false;
		}
		var val = parseFloat(this.value).toFixed(2);
		var rate = parseFloat($('#exchange_rate').val()).toFixed(2);
		$('#amount_check').val(val);
		$('#amount_check_thb').html(val*rate);
	});
	
	$('#transpost_amount').change(function(){
		var transpost_amount = this.value;
		if( transpost_amount != parseFloat(transpost_amount) ){
			alert('总金额格式错误');
			return false;
		}
		var val = parseFloat(this.value).toFixed(2);
		var rate = parseFloat($('#exchange_rate').val()).toFixed(2);;
		$('#transpost_amount').val(val);
		$('#transpost_amount_thb').html(val*rate);
	});
	
	</eq>
	
	$('#form1').submit(function(){
		var first_status = $('#status option:first').val();
		var first_text = $('#status option:first').text();
		var status = $('#status').val();
		var status_text = $('#status option:selected').text();
		
		<eq name="order_info.order_status" value="0">
		var flag = false;
		$('.edit_num_div').each(function(){
			if( $(this).css('display') != 'none')
				flag = true;
		});
		
		if( flag ){
			alert('请先确认商品数量');
			return false;
		}
		</eq>
		
		var msg = '';
		if( status > first_status )
			msg = '你确认将订单状态跳过“'+first_text+'”,直接变更为“'+status_text+'”吗？';
		else
			msg = '你确认将订单状态变更为：'+status_text+'吗？';
		
		if( !confirm( msg ) )
			return false;

		return true;
	});
});
//-->
</script>
<div id="main" class="main" >
<div class="content">
<div class="title">订单处理 [ <a href="__URL__">返回列表</a> ]</div>
<div class="fRig"><neq name="vo.image" value=''><img src="__PUBLIC__/Uploads/{$vo.image}"  width="160" height="120" style="border:1px solid silver;padding:1px" /></neq></div>
<div id="result" class="result none"></div>
<form method='post' id="form1" name="form1" action="__URL__/deal" >
<input type="hidden" name="id" value="{$order_info.order_id}" />
<input type="hidden" name="exchange_rate" id="exchange_rate" value="{$order_info.exchange_rate}" />
<!-- 列表显示区域  -->
<div class="list" >
<table id="checkList" class="list" cellpadding="0" cellspacing="0">
	<tbody>
		<tr>
			<td height="5" colspan="6" class="topTd"></td>
		</tr>
		<tr class="row">
			<th width="15%">商品地址</th>
			<th >单价</th>
			<th >颜色</th>
			<th >尺码</th>
			<th width="25%">数量/确认数量</th>
			<th >小计</th>
		</tr>
		<volist name="order_info.goods_info" id="vo">
		<assign name="price_thb" value="$vo['price_cny']*$order_info['exchange_rate']" />
		<assign name="t_price_cny" value="$vo['price_cny']*$vo['num']" />
		<assign name="t_price_thb" value="$t_price_cny*$order_info['exchange_rate']" />
		<assign name="all_num" value="$all_num + $vo['num']" />
		<assign name="all_num_check" value="$all_num_check + $vo['num_check']" />
		<assign name="all_price_cny" value="$all_price_cny + $t_price_cny" />
		<assign name="all_price_thb" value="$all_price_thb + $t_price_thb" />
		<tr class="row" onmouseover="over(event)" onmouseout="out(event)" >
			<td><a href='{$vo.goods_src}' target="_blank">点击打开</a></td>
			<td>￥{$vo.price_cny}(฿{$price_thb})</td>
			<td>{$vo.goods_color}</td>
			<td>{$vo.goods_size}</td>
			<td>
				{$vo.num}/<span id="num_check">{$vo.num_check}</span>
				<eq name="order_info.order_status" value="0">
				<a href="javascript:void(0);" style="margin-left:20px;" class="edit_num">修正数量</a>
				<div id="edit_num_div" class="edit_num_div" style="display:none">
					<input type="hidden" id="goods_id" name="goods_id[]" value="{$vo.goods_id}" />
					<input type="text" id="new_num" name="new_num[]" class="new_num" value="{$vo.num_check}" size="3" maxlength="3"/>
					<input type="button" class="button edit_num_ok" value="确认" />
					<input type="button" class="button edit_num_cancel" value="取消" />
				</div>
				</eq>
			</td>
			<td>￥{$t_price_cny}(฿{$t_price_thb})</td>
		</tr>
		</volist>
		<tr class="row">
			<th colspan="5"></th>
			<td>￥{$all_price_cny}(฿{$all_price_thb})</td>
		</tr>
		<tr>
			<td height="5" colspan="6" class="bottomTd"></td>
		</tr>
	</tbody>
</table>

<table cellpadding=0 cellspacing=0 class="list">
<tr>
	<th class="tRight" width="15%" >用户：</th>
	<td class="tLeft" >{$order_info.member.true_name}</td>
</tr>
<tr>
	<th class="tRight" >订单编号：</th>
	<td class="tLeft" >{$order_info.order_number}</td>
</tr>
<tr>
	<th class="tRight">货运方式：</th>
	<td class="tLeft" >{$order_info.transport}</td>
</tr>
<tr>
	<th class="tRight" >联系电话：</th>
	<td class="tLeft" >{$order_info.mobile}</td>
</tr>
<tr>
	<th class="tRight" >地址：</th>
	<td class="tLeft" >{$order_info.address}</td>
</tr>
<tr>
	<th class="tRight" >状态变更记录：</th>
	<td class="tLeft" >{$order_info.operation_log|nl2br}</td>
</tr>
<eq name="order_info.order_status" value="0">
<tr>
	<th class="tRight" >快递费：</th>
	<td class="tLeft">
		￥<input type="text" name="transpost_amount" id="transpost_amount" value="0" size="5" maxlength="5"/>
		฿<span id="transpost_amount_thb">0</span>
	</td>
</tr>
<tr>
	<th class="tRight" >总金额确认（不含快递费）：</th>
	<td class="tLeft" >
		￥<input type="text" name="amount_check" id="amount_check" value="{$all_price_cny}" size="10" maxlength="10"/>
		฿<span id="amount_check_thb">{$all_price_thb}</span>
	</td>
</tr>
<else/>
<tr>
	<th class="tRight" >快递费：</th>
	<td class="tLeft">
		￥{$order_info.transpost_amount}
		(฿{$order_info.transpost_amount_thb})
	</td>
</tr>
<tr>
	<th class="tRight" >总金额确认（不含快递费）：</th>
	<td class="tLeft" >
		￥{$order_info.amount_check}
		(฿{$order_info.amount_thb_check})
	</td>
</tr>
</eq>
<eq name="order_info.order_status" value="3">
<tr>
	<th class="tRight" >包裹重量：</th>
	<td class="tLeft" >
	<input type="text" name="weight" value="" />
	</td>
</tr>
</eq>
<in name="order_info.order_status" value="4,5">
<tr>
	<th class="tRight" >包裹重量：</th>
	<td class="tLeft" >
	{$order_info.weight}
	</td>
</tr>
</in>

<notin name="order_info.order_status" value="5">
<tr>
	<th class="tRight" >状态变更：</th>
	<td class="tLeft" >
	<html:select id="status" name="status" options="status_arr" />
	</td>
</tr>
</notin>
<tr>
	<th class="tRight" >代购备注：</th>
	<td class="tLeft" >
		<textarea name="admin_memo" style="width:500px;height:80px;">{$order_info.admin_memo}</textarea>
	</td>
</tr>
<notin name="order_info.order_status" value="5">
<tr>
	<td class="tRight" ></td>
	<td class="tLeft" >
		<input type="submit" value="保 存"  class="button small">
	</td>
</tr>
</notin>
</table>
</div>
</form>
</div>
</div>